<?php

/* 
 * Copyright (c) 2009 Nguyen Duc Thuan <me@ndthuan.com>
 * All rights reserved.
 */

class Fete_View_Helper_InlineScript extends Fete_View_Helper
{
    protected $_scripts = '';

    public function &inlineScript()
    {
        return $this;
    }

    public function &prepend($script)
    {
        $this->_scripts = $script . $this->_scripts;

        return $this;
    }

    public function &append($script)
    {
        $this->_scripts .= $script;

        return $this;
    }

    public function __toString()
    {
        return '<script type="text/javascript">' . "\n"
        . $this->_scripts . "\n" . '</script>';
    }
}